package com.example.qqfake;

import android.graphics.Bitmap;

public class User {
    private int id;
    private String username;
    private String password;

    private String gender;
    private String region;
    private String birthday;
    private Bitmap touxiang;


    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }
    public User(int id){
        this.id=id;
    }
    public User(){}
    public User(int id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
    }
    public User(int id,String username,Bitmap touxiang){
        this.id = id;
        this.username=username;
        this.touxiang = touxiang;

    }
    public User(int id,String username){
        this.id = id;
        this.username=username;

    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Bitmap getTouxiang() {
        return touxiang;
    }

    public void setTouxiang(Bitmap touxiang) {
        this.touxiang = touxiang;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    // 覆盖equals方法
    @Override
    public boolean equals(Object o) {
        // 如果比较的对象是自身，直接返回true
        if (this == o) return true;
        // 如果传入的对象为null，或者类型不匹配，返回false
        if (o == null || getClass() != o.getClass()) return false;
        // 转换为User类型进行比较
        User user = (User) o;
        // 比较id是否相等，这里假设id是用户的唯一标识
        return id == user.id;
    }

    // 覆盖hashCode方法
    @Override
    public int hashCode() {
        // 使用id作为哈希码，因为id是唯一的
        return id;
    }
}